<?php

/**
 * Description of MY_Model
 *
 * @author Meta Sanjaya
 */
class MY_Model extends CI_Model {
    /**
     *
     * @var CI_DB_driver
     */
    var $db;

    public function __construct() {
        parent::__construct();
        $this->db = & get_instance()->db;
    }

    /**
     *
     * @param string $model
     * @return object
     */
    function load_model($model) {
        require_once APPPATH . 'models/' . $model . EXT;
        
        $class = ucfirst($model);

        return(new $class());
    }

    /**
     *
     * @param mixed $var
     */
    function debug($var) {
        echo "<pre>";
        var_dump($var);
        echo "</pre>";
        exit;
    }
}
?>
